#include <iostream>
#define N 1000
using namespace std;
int stu_num[N]= {0},index_stu[N]={0};
int main_51()
{
    int n,m,p,q,start,stop,temp;
    cin>>n>>m;
    for (int i=0; i<n ; i++ )
    {
        stu_num[i]=i+1;
        index_stu[i+1]=i;
    }
    for (int j=0; j<m ; j++ )
    {
        cin>>p>>q;
        start=index_stu[p];
        stop=start+q;
        temp=stu_num[start];
        if (q>0)
        {
            for (int k=start; k<stop ; k++ )
            {
                stu_num[k]=stu_num[k+1];
                index_stu[stu_num[k+1]]--;
            }
        }
        else
        {
            for (int k=start; k>stop ; k-- )
            {
                stu_num[k]=stu_num[k-1];
                index_stu[stu_num[k-1]]++;
            }

        }
        index_stu[p]+=q;
        stu_num[stop]=temp;
    }
    for (int l=0; l<n ; l++ )
    {
        cout << stu_num[l] << " ";
    }
    return 0;
}
